/*
 * Layer.h
 *
 *  Created on: Aug 25, 2011
 *      Author: mengwei.chua
 */

#ifndef LAYER_H_
#define LAYER_H_

#include <string>
#include <deque>
#include "util/IXmlParsable.h"
#include "Properties.h"

namespace projectcos
{
namespace tile
{
namespace parser
{

// Class forward declaration
class Properties;

class Layer : public projectcos::util::IXmlParsable
{
public:
	class Data : public projectcos::util::IXmlParsable
	{
	public:
		Data();
		virtual ~Data();

		virtual bool Parse(const TiXmlElement* element);

		std::string GetEncoding() const;
		std::string GetCompression() const;
		std::string GetData() const;

	protected:
	private:
		std::string m_Encoding;
		std::string m_Compression;
		std::string m_Data;
	};

	Layer();
	virtual ~Layer();

	virtual bool Parse(const TiXmlElement* element);

	std::string GetName() const;
	float GetOpacity() const;
	bool GetVisible() const;
	void GetProperties(Properties& properties) const;
	void GetData(std::deque<Data>& data) const;

protected:
private:
	std::string m_Name;
	float m_Opacity;
	bool m_Visible;

	Properties m_Properties;
	std::deque<Data> m_DataList;
};

} // parser
} // tile
} // projectcos

#endif /* LAYER_H_ */
